<?php
require_once("../includes/config.php");
include DIR_INCLUDES_FT.'bootstrap.php';

switch ($_POST['accao']){
	case 'verifica_unidade':
		$num_rep = Doctrine_Query::create()->from("Unidades u")
			->where("u.sigla = ? and u.id != ?", array($_POST['sigla'],$_POST['id']))
			->count();
		if($num_rep > 0){
			echo json_encode(false);
		} else {
			echo json_encode(true);
		}
	break;
}

?>